//
//  RegisterViewController.m
//  LvZhi201805
//
//  Created by 付明玉 on 2018/5/17.
//  Copyright © 2018年 付明玉. All rights reserved.
//

#import "RegisterViewController.h"

@interface RegisterViewController ()

@end

@implementation RegisterViewController

- (void)viewDidLoad {
    
    [super viewDidLoad];
    
    //背景色
    self.view.backgroundColor = COLOR(251, 251, 251, 1);
    
    //添加背景边框
    UIView *bgView = [[UIView alloc] init];
    [self.view addSubview:bgView];
    [bgView mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(self.view.mas_left).offset(17);
        make.right.mas_equalTo(self.view.mas_right).offset(-17);
        make.top.mas_equalTo(self.view.mas_top).offset(120);
        make.height.mas_equalTo(180);
    }];
    bgView.layer.borderColor = [COLOR(229, 229, 229, 1) CGColor];
    bgView.layer.borderWidth = 1;
    bgView.layer.cornerRadius = 3;
    
    //添加分割线
    UILabel *firstMidLabel = [[UILabel alloc] init];
    [bgView addSubview:firstMidLabel];
    [firstMidLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(bgView.mas_left).offset(0);
        make.right.mas_equalTo(bgView.mas_right).offset(0);
        make.top.mas_equalTo(bgView.mas_top).offset(45);
        make.height.mas_equalTo(1);
    }];
    firstMidLabel.backgroundColor = COLOR(229, 229, 229, 1);
    
    UILabel *secondMidLabel = [[UILabel alloc] init];
    [bgView addSubview:secondMidLabel];
    [secondMidLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(bgView.mas_left).offset(0);
        make.right.mas_equalTo(bgView.mas_right).offset(0);
        make.top.mas_equalTo(bgView.mas_top).offset(90);
        make.height.mas_equalTo(1);
    }];
    secondMidLabel.backgroundColor = COLOR(229, 229, 229, 1);
    
    UILabel *thirdMidLabel = [[UILabel alloc] init];
    [bgView addSubview:thirdMidLabel];
    [thirdMidLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(bgView.mas_left).offset(0);
        make.right.mas_equalTo(bgView.mas_right).offset(0);
        make.top.mas_equalTo(bgView.mas_top).offset(135);
        make.height.mas_equalTo(1);
    }];
    thirdMidLabel.backgroundColor = COLOR(229, 229, 229, 1);
    
    //邮箱/手机号
    self.userNameTextFiled = [[UITextField alloc] init];
    [bgView addSubview:self.userNameTextFiled];
    [self.userNameTextFiled mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(bgView.mas_left).offset(18);
        make.right.mas_equalTo(bgView.mas_right).offset(0);
        make.top .mas_equalTo(bgView.mas_top).offset(17);
        make.height.mas_equalTo(13);
    }];
    self.userNameTextFiled.placeholder = @"邮箱/用户名/手机号";
    self.userNameTextFiled.font = [UIFont systemFontOfSize:12];
    
    //密码
    self.passwordTextFiled = [[UITextField alloc] init];
    [bgView addSubview:self.passwordTextFiled];
    [self.passwordTextFiled mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(bgView.mas_left).offset(18);
        make.right.mas_equalTo(bgView.mas_right).offset(0);
        make.top .mas_equalTo(bgView.mas_top).offset(62);
        make.height.mas_equalTo(13);
    }];
    self.passwordTextFiled.placeholder = @"请输入密码";
    self.passwordTextFiled.font = [UIFont systemFontOfSize:12];
    
    //确认密码
    self.sureForPasswordTextFiled = [[UITextField alloc] init];
    [bgView addSubview:self.sureForPasswordTextFiled];
    [self.sureForPasswordTextFiled mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(bgView.mas_left).offset(18);
        make.right.mas_equalTo(bgView.mas_right).offset(0);
        make.top .mas_equalTo(bgView.mas_top).offset(106);
        make.height.mas_equalTo(13);
    }];
    self.sureForPasswordTextFiled.placeholder = @"确认密码";
    self.sureForPasswordTextFiled.font = [UIFont systemFontOfSize:12];
    
    //验证码
    self.verificationCodeTextFiled = [[UITextField alloc] init];
    [bgView addSubview:self.verificationCodeTextFiled];
    [self.verificationCodeTextFiled mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(bgView.mas_left).offset(18);
        make.right.mas_equalTo(bgView.mas_right).offset(0);
        make.bottom .mas_equalTo(bgView.mas_bottom).offset(-18);
        make.height.mas_equalTo(13);
    }];
    self.verificationCodeTextFiled.placeholder = @"验证码";
    self.verificationCodeTextFiled.font = [UIFont systemFontOfSize:12];
    
    //获取验证码
    self.getVerificationCodeButton = [[UIButton alloc] init];
    [self.view addSubview:self.getVerificationCodeButton];
    [self.getVerificationCodeButton mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(self.view.mas_right).offset(-139);
        make.right.mas_equalTo(bgView.mas_right).offset(0);
        make.top.mas_equalTo(bgView.mas_bottom).offset(-45);
        make.height.mas_equalTo(46);
    }];
    self.getVerificationCodeButton.backgroundColor = COLOR(241, 145, 73, 1);
    [self.getVerificationCodeButton setTitle:@"获取验证码" forState:UIControlStateNormal];
    [self.getVerificationCodeButton addTarget:self action:@selector(clickGetVerificationCodeButton) forControlEvents:UIControlEventTouchUpInside];
    
    //注册
    self.registerButton = [[UIButton alloc] init];
    [self.view addSubview:self.registerButton];
    [self.registerButton mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(self.view.mas_left).offset(18);
        make.right.mas_equalTo(self.view.mas_right).offset(-18);
        make.top.mas_equalTo(bgView.mas_bottom).offset(34);
        make.height.mas_equalTo(45);
    }];
    self.registerButton.backgroundColor = COLOR(18, 79, 151, 1);
    [self.registerButton setTitle:@"注册" forState:UIControlStateNormal];
    self.registerButton.layer.cornerRadius = 3;
    [self.registerButton.titleLabel setFont:[UIFont systemFontOfSize:15]];
    [self.registerButton addTarget:self action:@selector(clickRegisterButton) forControlEvents:UIControlEventTouchUpInside];
    

}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    
    //标题
    self.navigationItem.title = @"注册";
    
    //背景色
    [self.navigationController.navigationBar setBarTintColor:COLOR(18, 79, 151, 1)];
    
    //字体颜色
    self.navigationController.navigationBar.barStyle = UIBarStyleBlack;
    
    //设置返回按钮颜色
    self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
    self.navigationController.navigationBar.topItem.title = @"";
    
    //字体
    [self.navigationController.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor], NSForegroundColorAttributeName, [UIFont fontWithName:@"AmericanTypewriter-Bold" size:18], NSFontAttributeName, nil]];
}

#pragma mark - 点击获取验证码按钮
- (void)clickGetVerificationCodeButton
{
    
}

#pragma mark - 点击注册按钮
- (void)clickRegisterButton
{
    
}

@end
